package com.springtest.demo.model;

import java.io.Serializable;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.Table;

import com.fasterxml.jackson.annotation.JsonView;
import com.springtest.demo.views.ResultView;

public class ResultEntity {
	
	@JsonView(ResultView.ResultInfoView.class)
	private int errorCode;
	
	@JsonView(ResultView.ResultInfoView.class)
	private String errorMessage;
	
	@JsonView(ResultView.ResultInfoView.class)
	private Object data;
	
	public ResultEntity(){
		errorCode=0;
		errorMessage="success";
		data=null;
	}
	
	public static ResultEntity getInstance(){
		return new ResultEntity(); 
	}

	public int getErrorCode() {
		return errorCode;
	}

	public ResultEntity setErrorCode(int errorCode) {
		this.errorCode = errorCode;
		return this;
	}

	public String getErrorMessage() {
		return errorMessage;
	}

	public ResultEntity setErrorMessage(String errorMessage) {
		this.errorMessage = errorMessage;
		return this;
	}

	public Object getData() {
		return data;
	}

	public ResultEntity setData(Object data) {
		this.data = data;
		return this;
	}

	
}
